package com.franklin.java.api.ui.tree;

import com.franklin.java.utils.ProjectUtils;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.NlsSafe;
import com.intellij.ui.treeStructure.CachingSimpleNode;
import com.intellij.ui.treeStructure.SimpleNode;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.Nullable;

import java.util.List;

/**
 * @author Franklin
 * @since 2021/9/13 10:31
 */
public abstract class BaseSimpleNode<child extends BaseSimpleNode<child>> extends CachingSimpleNode {

    protected List<child> childrenNodeList;

    protected Project project;

    protected BaseSimpleNode(SimpleNode aParent) {
        super(aParent);
        project = ProjectUtils.getCurrProject();
    }

    @Nullable
    @NonNls
    String getActionId() {
        return null;
    }

    @Nullable
    @NonNls
    String getMenuId() {
        return null;
    }

    @Override
    public void cleanUpCache() {
        super.cleanUpCache();
    }

    public List<child> getChildrenNodeList() {
        return childrenNodeList;
    }

    public void setChildrenNodeList(List<child> childrenNodeList) {
        this.childrenNodeList = childrenNodeList;
    }

    @Override
    public abstract String getName();
}
